<?php

class CreatePetAction extends CAction
{
	public function run()
	{
		$user=&$this->getController()->getUser();
		if($user===null)
			throw CHttpExeption(500, 'cannot find user['.Yii::app()->user->name.']');

		$user->addPet(Pet::create($_POST['petcategory']));
		$this->getController()->redirect(array('ListPet'));
	}
}

?>
